<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:pe="http://primefaces.org/ui/extensions">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition>
         
                <h:form>
                      <script type="text/javascript">  
                function handleSaveChangePasswd(xhr, status, args) {  
                    alert("kadieu");
                    if(args.validationFailed || !args.success) {  
                        jQuery('dialog').effect("shake", { times:3 }, 100);  
                    } else {  
                        dlgChangePasswd.hide();  
                    }  
                }
                
             
            </script>
                <h:panelGrid id="displayUserChangePasswd" columns="2" styleClass="addELIT">
                   <!-- <p:messages id="messages" showDetail="true" autoUpdate="true"/> -->
                    <h:outputLabel value= "#{bundle.userName} :" />
                    
                    <p:inputText readonly="true" rendered="#{usersBean.insertedData!=null}" value="#{usersBean.insertedData.userName}" size="40" />

                     <h:outputLabel style="padding: 0 15px 0 0; " value= "#{bundle.fullName} :" />
                    
                     <p:inputText readonly="true" rendered="#{usersBean.insertedData!=null}" value="#{usersBean.insertedData.fullName}" size="25" />
                    
                    <h:outputLabel value= "New #{bundle.password} :" />
                   
                    <p:password  rendered="#{usersBean.insertedData!=null}" id="newPasswd1" match="newPasswd2" required="true" 
                                 requiredMessage="New #{bundle.password} #{bundle.requiredInput}" valueChangeListener="#{usersBean.passwordIsChange()}" size="30" feedback="true" inline="true" redisplay="false"/>
                   
                     <h:outputLabel value= "Confirm #{bundle.password} :" />
                   
                     <p:password  rendered="#{usersBean.insertedData!=null}" id="newPasswd2" required="true" 
                                 requiredMessage="Confirm #{bundle.password} #{bundle.requiredInput}" value="#{usersBean.insertedData.password}" valueChangeListener="#{usersBean.passwordIsChange()}" size="30" feedback="true" inline="true" redisplay="false"/>   
                    
                </h:panelGrid>

                <h:panelGrid cellpadding="0" styleClass="pComBtnSTDR">
                    <f:facet name="footer">
                        <p:commandButton value="#{bundle.btnSave}" image="ui-icon-disk" action="#{usersBean.save()}"                                         
                                         oncomplete="handleSaveChangePasswd(xhr, status, args)" />  
                        <p:commandButton immediate="true" value="#{bundle.btnClose}" oncomplete="dlgChangePasswd.hide()" image="ui-icon-document"/>
                    </f:facet>
                </h:panelGrid>
                    </h:form>
          
        </ui:composition>       
    </h:body>
</html>

